<?php
include("function.php");
init_connect_db();
$title = $_POST['title'];
$type = $_POST['type'];
$article = $_POST['article'];
$city = $_POST['city'];
$userId = $_POST['userId'];
$dateCreate = date("Y-m-d H:i:s");
$temp = "INSERT INTO Tips (id, title, type, article, city, Users_id, dateEdit, dateCreate) VALUES (NULL, '$title', '$type', '$article', '$city', '$userId', '$dateCreate', '$dateCreate')";
$query = mysql_query($temp);
if (!$query){
	printf('Could not execut the query');
	exit();
}
$query = mysql_query("SELECT title,id FROM Places");
if (!$query) {
	printf('Could not execut the query');
	exit();
}
header('Location: ' . $_SERVER['HTTP_REFERER']);
?>